<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>陵水县建设工程决策支持系统</title>
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link rel="stylesheet" href="../static/css/reset.css" th:href="@{/css/reset.css}">
    <link href="../static/js/plugins/My97DatePicker/skin/WdatePicker.css" th:href="@{/js/plugins/My97DatePicker/skin/WdatePicker.css}" rel="stylesheet">
    <link rel="stylesheet" href="../static/js/plugins/icheck-1.x/skins/all.css" th:href="@{/js/plugins/icheck-1.x/skins/all.css}">
    <link rel="stylesheet" href="../static/css/public.css" th:href="@{/css/public.css}">
</head>

<body>
    <div class="wrapper wrapper-content animated fadeInRight">
        <!-- 头部-->
        <div class="title">
            <p>陵水县建设工程决策支持系统</p>
        </div>
        <div class="div_form" style="width: 100%;">
            <div class="sec-filter clearfix">
                <div class="filter-part">
                    <!--类型-->
                    <dl>
                        <dt data-val="">选择日期</dt>
                    </dl>
                </div>
                <input id="startdate" style="color: #000;border: 1px solid #303389;margin-left: 5px;text-align: center"
                    class="Wdate"
                    onClick="WdatePicker({onpicked:function(dp){var newDate=dp.cal.getNewDateStr();setstart(newDate);},dateFmt:'yyyy-MM',skin:'whyGreen',maxDate:'#F{$dp.$D(\'enddate\')}'})" />&nbsp;&nbsp;至&nbsp;
                <input id="enddate" style="color: #000;border: 1px solid #303389;margin-left: 5px;text-align: center"
                    class="Wdate"
                    onclick="WdatePicker({onpicked:function(dp){var newDate=dp.cal.getNewDateStr();setend(newDate);},dateFmt:'yyyy-MM',skin:'whyGreen',minDate:'#F{$dp.$D(\'startdate\')}',maxDate:'%y-12-31'})" />
                <!--选完的条件-->
                <div class="checkbox" style="display: inline-block;margin: 0;padding-left: 3%;">
                    <label class="check-box" style="font-size: 14px;font-weight: 700;">
                        <input type="checkbox" value="option1" id="inlineCheckbox1">&nbsp;&nbsp; 包括私人住宅</label>
                </div>
                <!--数据更新时间-->
                <span class="last-update">
                    <em>现在时间</em>
                    <em id="text">
                        2019-12-30
                    </em>
                </span>
            </div>
        </div>
        <!--导航栏  -->
        <div class="row t-navbar">
            <!--四个角-->
            <div class="adorn lt"></div>
            <div class="adorn rt"></div>
            <div class="adorn lb"></div>
            <div class="adorn rb"></div>
            <div class="tabs">
                <a href="/buildIndex/analysis" class="active">建设工程开工情况</a>
                <a href="/houseconstruction/analysis">房建工程开工情况</a>
                <a href="/municipalEngineering/analysis">市政工程开工情况</a>
            </div>
        </div>

        <!-- 内容主体 -->
        <div class="word-area">
            <div class="content active">
                <!-- =====================================市政================================= -->
                <div class="row rowmain environment">
                    <div class="col-md-2 left" style="width: 20%;">
                        <div class="box box1">
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">市政项目总览</p>
                            <div style="overflow: hidden; height: 85%;">
                                <table class="table-body" style="table-layout:fixed;width: 100%;margin-top: 10px;">
                                    <tbody>
                                        <tr>
                                            <td style="width: 60%;">
                                                <span>当期开工项目总数：</span>
                                                <span class="num yellow" id="all">1768</span>
                                            </td>
                                            <td>
                                                <span>同比：</span>
                                                <span class="num red" id="rate">30%</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 60%;">
                                                <span >当期开工项目总金额：</span>
                                                <span class="num yellow" id="allt">856.8</span>
                                            </td>
                                            <td>
                                                <span>同比：</span>
                                                <span class="num green" id="ratet">-10%</span>
                                            </td>
                                        </tr>
                                        <!-- <tr>
                                            <td style="width: 60%;">
                                                <span>当期开工项目总面积：</span>
                                                <span class="num yellow">771.8</span>
                                            </td>
                                            <td>
                                                <span>同比：</span>
                                                <span class="num green">-35%</span>
                                            </td>
                                        </tr> -->
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="box box2">
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">各类型市政项目占比</p>
                            <div style="overflow: hidden; height: 90%;">
                                <div id="shizhengybp"></div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-7" style="height: 100%;padding: 0;">
                        <div class="box box3">
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <div class="top_tab">
                                <ul class="top_tabs-three">
                                    <li >开工数量热力图</li>
                                    <!-- <li>开工面积热力图</li> -->
                                    <li class="active">详细数据</li>
                                </ul>
                            </div>
                            <div class="tab_box-content" style="width: 100%;height: 100%;">
                                <div class="box-content absolute-content dbox">
                                    <div id="map1"></div>
                                </div>
                                <div class="box-content absolute-content dbox active">
                                    <table border="0" cellpadding="0" cellspacing="0"
                                        style=" width: 100%;word-break:break-all;margin-top: 2%;">
                                        <tbody>
                                            <tr>
                                                <td>
                                                    <div class="page-title" style="color: rgb(173, 194, 255);">
                                                        <span>全县开工工程项目统计表</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                        <span>单位：面积：万平方米&nbsp;&nbsp;&nbsp;&nbsp;金额：亿元</span>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table class="tbEidt" align="center"
                                                        style=" width: 100%;word-break:break-all;">
                                                        <thead>
                                                        	<tr>
                                                                <td class="tdTitle">市县</td>
                                                                <td class="tdContent">总数量</td>
                                                                <td class="tdContent">同比</td>
                                                                <td class="tdContent">总投资</td>
                                                                <td class="tdContent">同比</td>
                                                            </tr>
                                                        </thead>
                                                        <tbody id="saletable">
                                                            <tr>
                                                                <td class="tdContent">全省</td>
                                                                <td class="tdContent">2034</td>
                                                                <td class="tdContent">-40%</td>
                                                                <td class="tdContent">896.8</td>
                                                                <td class="tdContent">-40%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">海口市</td>
                                                                <td class="tdContent">964</td>
                                                                <td class="tdContent">6%</td>
                                                                <td class="tdContent">477.8</td>
                                                                <td class="tdContent">5%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">三亚市</td>
                                                                <td class="tdContent">534</td>
                                                                <td class="tdContent">-41%</td>
                                                                <td class="tdContent">99.8</td>
                                                                <td class="tdContent">-41%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">儋州市</td>
                                                                <td class="tdContent">534</td>
                                                                <td class="tdContent">-41%</td>
                                                                <td class="tdContent">24.85</td>
                                                                <td class="tdContent">-76%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">东方市</td>
                                                                <td class="tdContent">43</td>
                                                                <td class="tdContent">-34%</td>
                                                                <td class="tdContent">33.83</td>
                                                                <td class="tdContent">-34%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">万宁市</td>
                                                                <td class="tdContent">54</td>
                                                                <td class="tdContent">-40%</td>
                                                                <td class="tdContent">11.8</td>
                                                                <td class="tdContent">-41%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">临高县</td>
                                                                <td class="tdContent">45</td>
                                                                <td class="tdContent">-91%</td>
                                                                <td class="tdContent">13.49</td>
                                                                <td class="tdContent">-91%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">澄迈县</td>
                                                                <td class="tdContent">97</td>
                                                                <td class="tdContent">-25%</td>
                                                                <td class="tdContent">7.8</td>
                                                                <td class="tdContent">-25%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">文昌市</td>
                                                                <td class="tdContent">66</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">186.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">陵水县</td>
                                                                <td class="tdContent">485</td>
                                                                <td class="tdContent">4%</td>
                                                                <td class="tdContent">200.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">乐东市</td>
                                                                <td class="tdContent">456</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">186.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">昌江县</td>
                                                                <td class="tdContent">436</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">196.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">保亭县</td>
                                                                <td class="tdContent">436</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">196.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">屯昌县</td>
                                                                <td class="tdContent">436</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">196.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">琼海市</td>
                                                                <td class="tdContent">436</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">196.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">定安县</td>
                                                                <td class="tdContent">436</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">196.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">琼中县</td>
                                                                <td class="tdContent">436</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">196.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">白沙县</td>
                                                                <td class="tdContent">436</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">196.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdContent">五指山市</td>
                                                                <td class="tdContent">436</td>
                                                                <td class="tdContent">3%</td>
                                                                <td class="tdContent">196.8</td>
                                                                <td class="tdContent">4%</td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2 left" style="width: 20.66%;margin-left: 1%;">
                        <div class="box box5">
                            <div class="icon-open1" title="放大" id="btn_open_area1">打开弹窗报表</div>
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">全县开工月度趋势</p>
                            <div class="box-content">
                                <div id="shizhennoise1"></div>
                            </div>
                        </div>
                        <div class="box box5">
                            <div class="icon-open1" title="放大" id="btn_open_area2">打开弹窗报表</div>
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">投资金额月度趋势</p>
                            <div class="box-content">
                                <div id="shizhennoise2"></div>
                            </div>
                        </div>
                        <div class="box box5">
                            <div class="icon-open1" title="放大" id="btn_open_area3">打开弹窗报表</div>
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">市政工程规模横占比</p>
                            <div class="box-content">
                                <div id="shizhennoise3"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--弹窗类报表-->
        <div class="popup-fullbg undis"></div>
        <div class="popup-report undis" id="right_trend_month12_popup">
            <div class="btn-close">x</div>
            <div class="popup-hd"></div>
            <div class="trend-month12" id="trend-month12"></div>
            <!-- <div class="icon-open3" title="切换" onclick="toggleLines2(0)">切换弹窗报表</div> -->
        </div>
    </div>
    <script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"> </script>
    <script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
    <script src="../static/js/plugins/echarts@3.8.5/echarts.js" th:src="@{/js/plugins/echarts@3.8.5/echarts.js}"></script>
    <script src="../static/js/plugins/My97DatePicker/WdatePicker.js" th:src="@{/js/plugins/My97DatePicker/WdatePicker.js}"></script>
    <script src="../static/js/plugins/icheck-1.x/icheck.js" th:src="@{/js/plugins/icheck-1.x/icheck.js}"></script>
    <script src="../static/js/custom.js" th:src="@{/js/custom.js}"></script>
    <script src="../static/js/common.js" th:src="@{/js/common.js}"></script>
    <script>
        function setstart(newDate) {
            if (newDate.split("-").length > 2) {
                let s = newDate.split("-");
                sessionStorage.removeItem("startyear");
                sessionStorage.setItem("startyear", s[0] + "-" + s[1]);
                sessionStorage.removeItem("startdate");
                sessionStorage.setItem("startdate", newDate);
                // 调用接口
				refresh();
            } else {
                sessionStorage.removeItem("startyear");
                sessionStorage.setItem("startyear", newDate);
                // 记录选择时间
                let s = newDate.split("-");
                sessionStorage.removeItem("tyear");
                sessionStorage.setItem("tyear", s[0]);
                sessionStorage.removeItem("tmonth");
                sessionStorage.setItem("tmonth", s[1]);
                refresh();
            }
        };

        function setend(newDate) {
            var start = $("#startdate").val();
            if (start > newDate) {
                return;
            } else {
                if (newDate.split("-").length > 2) {
                    let s = newDate.split("-");
                    sessionStorage.removeItem("endyear");
                    sessionStorage.setItem("endyear", s[0] + "-" + s[1]);
                    sessionStorage.removeItem("enddate");
                    sessionStorage.setItem("enddate", newDate);
                    refresh();
                } else {
                    sessionStorage.removeItem("endyear");
                    sessionStorage.setItem("endyear", newDate);
                    let s = newDate.split("-");
                    sessionStorage.removeItem("eyear");
                    sessionStorage.setItem("eyear", s[0]);
                    sessionStorage.removeItem("emonth");
                    sessionStorage.setItem("emonth", s[1]);
                    // 调用接口
					refresh();
                }
            }
        };
        /**
         * 页签选中
         */
        function initNavigator() {
            var currentUrl = location.pathname;
            $(".tabs a").removeClass("active").each(function (idx, item) {
                var tabUrl = $(item).attr("href");
                if (tabUrl == currentUrl) {
                    $(item).addClass("active");
                }
            })
        };
        /**
         * 初始化cookie中条件
         */
        function initCookie() {
            var currentUrl = location.pathname;
            var now = new Date();
            var currentYear = now.getFullYear();
            /* var currentMonth = now.getMonth() + 1;
            if (currentMonth < 10) {
                currentMonth = "0" + currentMonth;
            }; */
            var currentMonth = '01';
            var lastMonth = '12';
            var tyear = sessionStorage.getItem("tyear") ? sessionStorage.getItem("tyear") :
                currentYear;
            var tmonth = sessionStorage.getItem("tmonth") ? sessionStorage.getItem("tmonth") : currentMonth;
            var
                eyear = sessionStorage.getItem("eyear") ? sessionStorage.getItem("eyear") : currentYear;
            var emonth = sessionStorage.getItem("emonth") ?
                sessionStorage.getItem("emonth") :
                	lastMonth;
            // var year="2020" ; 
            // var month="01" ;
            sessionStorage.removeItem("index");
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "0";;
            sessionStorage.removeItem("type");
            sessionStorage.setItem("type", type);
            sessionStorage.removeItem("year");
            sessionStorage.setItem("tyear", tyear);
            sessionStorage.removeItem("tmonth");
            sessionStorage.setItem("tmonth", tmonth);
            sessionStorage.removeItem("eyear");
            sessionStorage.setItem("eyear", eyear);
            sessionStorage.removeItem("emonth");
            sessionStorage.setItem("emonth", emonth);
            sessionStorage.removeItem("startyear");
            sessionStorage.setItem("startyear", tyear + "-" + tmonth);
            sessionStorage.removeItem("endyear");
            sessionStorage.setItem("endyear", eyear + "-" + emonth);
        };
        /**
         * 筛选条件选中
         */
        function initFilter() {
            var type = sessionStorage.getItem("type");
            //条件选中
            // var $cb = $(".cb");
            // $cb.prop('checked');
            $('.checkbox input').on(
                // ifCreated ifClicked ifChanged ifChecked ifUnchecked ifDisabled ifEnabled ifDestroyed
                'ifChecked ifUnchecked',
                function (event) {
                    var str = event.type.replace('if', '').toLowerCase();
                    if (str == "checked") {
                        sessionStorage.setItem("type", '1');
                        refresh();
                        var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
                        var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
                        var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
                        if(sessionStorage.getItem("index") == '0'){
                        	loadmapcount(startyear,endyear,type);
                        }
                    } else if (str == "unchecked") {
                        sessionStorage.removeItem("type");
                        sessionStorage.setItem("type", '0');
                        refresh();
                        var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
                        var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
                        var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
                        if(sessionStorage.getItem("index") == '0'){
                        	loadmapcount(startyear,endyear,type);
                        }
                    }
                }).iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%'
            });
        };
        function toPercent(point){
            if (point==0) {
                return 0;
            }
            var str=Number(point).toFixed();
            str+="%";
            return str;
        };
        /*各类型房建项目占比 */
        function loadpieChart(){
        	var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/municipalEngineering/comparemeprotype",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var data = res;
                	var legendata = [];
                	var serise =[];
                	var resobj = [];
                	$.each(data, function (idx, obj) {
                		legendata.push(obj.projectType);
                		serise.push(obj.projectNum);
                	});
                	var  result = [];
            		for(var index in legendata){
            		     result.push({name: legendata[index], value: serise[index]});
            		 }; 
            		 var shizhengybp = $('#shizhengybp').eq(0).get(0);
                	toChartPie(shizhengybp,legendata,result);
                }
            });
        };
     // 表格数据
        function dataDetail() {
           $("#saletable").html('正在统计， 请稍等...... ');
            var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/municipalEngineering/indexmetable",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                    var data = res;
                    var str = '';
                    $.each(data, function (idx, obj) {
                        if (obj.projectCityNum == '陵水县') {
                        	$('#all').text(obj.totalNum);
                        	$("#rate").text(toPercent(obj.comparedTotalNum));
                        	$('#allt').text((obj.totalMoney/10000).toFixed(2));
                        	$('#ratet').text(toPercent(obj.comparedTotalMoney));
                        }; 
                        str += '<tr>' +
                        '<td class="tdContent">' + obj.projectCityNum + '</td>' +
                        '<td class="tdContent">' + obj.totalNum + '</td>' +
                        '<td class="tdContent">' + toPercent(obj.comparedTotalNum) + '</td>' +
                        '<td class="tdContent">' + (obj.totalMoney/10000).toFixed(2) + '</td>' +
                        '<td class="tdContent">' + toPercent(obj.comparedTotalMoney) + '</td>' +
                        '</tr>';
                    });
                    $("#saletable").html(str);
                }
            });
        };
      //加载数量地图
        function loadmapcount(startyear,endyear,type) {
            $.ajax({
                url: "/municipalEngineering/startnumrltme",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var data = res;
                    var mapObj={};
                    var legendata = [];
                	var serise =[];
                	$.each(data, function (idx, obj) {
                		mapObj.name = completeRegion(obj.name);
                		mapObj.value= obj.value;
                		legendata.push(mapObj);
                		serise.push((obj.value/10000).toFixed(2));
                	});
                     var orange = {};
                     orange.min = parseInt(getMaxMin(serise,"max"));
            		 orange.max = parseInt(getMaxMin(serise,"min"));
                    var data = res;
                    var map1 = $('#map1').eq(0).get(0);
                    toCharMap(1, map1, 'demo', "hainan.json",orange, ['1月'],legendata,
                    '开工数量(个 )', startyear, endyear);
                }
            });
        };
        /*树量月度趋势  */
        function loadlineChart(){
        	var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/municipalEngineering/startallmenummonthzst",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var data = res;
                	var noise1 = $('#shizhennoise1').eq(0).get(0);
                	toDoubleLine1(noise1,data,['开工数量 ','同比 ']);
                }
            });
        };
        /*金额月度趋势  */
        function loadlineChart1(){
        	var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/municipalEngineering/startallmemoneymonthzst",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var numTotalLastArr = [];
                	var numTotalNowArr = [];
                	for(var i = 0 ; i<res.moneyTotalArr.length; i++ ){
                		numTotalLastArr.push((res.moneyTotalArr[i]/10000).toFixed(2));
            		}
                	for(var i = 0 ; i<res.moneyTotalCompareArr.length; i++ ){
                		numTotalNowArr.push(res.moneyTotalCompareArr[i]);
            		};
                	var data = {};
                	data.month = res.month;
                	data.numTotalArr = numTotalLastArr;
                	data.numTotalCompareArr = numTotalNowArr;
                	var noise2 = $('#shizhennoise2').eq(0).get(0);
                	toDoubleLine1(noise2,data , ['投资金额  ','同比 ']);
                }
            });
        };
        /*市政工程规模占比   */
        function loadLinebar(){
        	var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/municipalEngineering/compareproarea",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var data = res;
                	var noise3 = $('#shizhennoise3').eq(0).get(0);
                	 toChartBar(noise3,data);
                }
            });
        };
      //当前时间
        function currentTime() {
            var now = new Date();
            var year = now.getFullYear();
            var month = now.getMonth() + 1;
            var day = now.getDate();

            var hh = now.getHours();
            var mm = now.getMinutes();

            var clock = year + "-";

            if (month < 10) clock += "0";
            clock += month + "-";
            if (day < 10) clock += "0";
            clock += day + " ";
            if (hh < 10)
                clock += "0";
            clock += hh + ":";
            if (mm < 10) clock += '0';
            clock += mm;
            return (clock);
        };
      //更新数据
        function refresh() {
           	dataDetail();
           	loadlineChart();
            loadpieChart();
            loadlineChart1();
            loadLinebar();
        };
      	//页面初始化。。。
        $(document).ready(function () {
        	initFilter();
            initCookie();
            initNavigator();
            refresh();
            var startYear = sessionStorage.getItem("startyear");
            var endYear = sessionStorage.getItem("endyear");
            $("#startdate").val(startYear);
            $("#enddate").val(endYear);
            $("#text").text(currentTime());
            // 市政
            $('.top_tabs-three li').click(function () {
                $(this).addClass('active').siblings().removeClass('active');
                var index = $(this).index();
                $(".tab_box-content .dbox").eq(index).show().siblings().hide();
                if ($(this).index() == 0) {
                	sessionStorage.setItem("index",'0');
                    var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
                    var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
                    var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
                    loadmapcount(startyear,endyear,type);
                }
            });

            //打开弹窗报表
            /* $('body').on('click', '.icon-open1', function () {
                $('.popup-fullbg').removeClass('undis');
                $('#right_trend_month12_popup').removeClass('undis');
                // toDoubleLine(right_trend_month12, data3);
            }); */
            //关闭弹窗报表
            $('body').on('click', '.popup-report .btn-close', function () {
                $('.popup-fullbg').addClass('undis');
                $('.popup-report').addClass('undis');
            });
            //关闭弹窗报表
            $('body').on('click', '.popup-fullbg', function () {
                $('.popup-fullbg').addClass('undis');
                $('.popup-report').addClass('undis');
            });
          //打开弹窗报表
            $('body').on('click', '#btn_open_area1', function () {
                $('.popup-fullbg').removeClass('undis');
                $('.popup-report').removeClass('undis');
                var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
                var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
                var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
                $.ajax({
                    url: "/municipalEngineering/startallmenummonthzst",
                    data: {
                        "timeNowBegin": startyear,
                        "timeNowEnd": endyear,
                        "isPrivateConstruction": type
                    },
                    //type: "post",
                    dataType: "json",
                    success: function (res) {
                    	var data = res;
                    	var trend = $('#trend-month12').eq(0).get(0);
                    	toDoubleLine1(trend,data,['开工数量 ','同比 ']);
                    }
                });
            });
            //打开弹窗报表
            $('body').on('click', '#btn_open_area2', function () {
                $('.popup-fullbg').removeClass('undis');
                $('.popup-report').removeClass('undis');
                var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
                var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
                var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
                $.ajax({
                    url: "/municipalEngineering/startallmemoneymonthzst",
                    data: {
                        "timeNowBegin": startyear,
                        "timeNowEnd": endyear,
                        "isPrivateConstruction": type
                    },
                    //type: "post",
                    dataType: "json",
                    success: function (res) {
                    	var numTotalLastArr = [];
                    	var numTotalNowArr = [];
                    	for(var i = 0 ; i<res.moneyTotalArr.length; i++ ){
                    		numTotalLastArr.push((res.moneyTotalArr[i]/10000).toFixed(2));
                		}
                    	for(var i = 0 ; i<res.moneyTotalCompareArr.length; i++ ){
                    		numTotalNowArr.push(res.moneyTotalCompareArr[i]);
                		};
                    	var data = {};
                    	data.month = res.month;
                    	data.numTotalArr = numTotalLastArr;
                    	data.numTotalCompareArr = numTotalNowArr;
                    	var trend = $('#trend-month12').eq(0).get(0);
                    	toDoubleLine1(trend,data , ['投资金额  ','同比 ']);
                    }
                });
            });
            $('body').on('click', '#btn_open_area3', function () {
                $('.popup-fullbg').removeClass('undis');
                $('.popup-report').removeClass('undis');
                var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
                var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
                var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
                $.ajax({
                    url: "/municipalEngineering/compareproarea",
                    data: {
                        "timeNowBegin": startyear,
                        "timeNowEnd": endyear,
                        "isPrivateConstruction": type
                    },
                    //type: "post",
                    dataType: "json",
                    success: function (res) {
                    	var data = res;
                    	var trend = $('#trend-month12').eq(0).get(0);
                    	 toChartBar(trend,data);
                    }
                });
            });
        });
    </script>

</body>

</html>